package com.atguigu.util.method;

/**
 * @author caesar
 * @date 2025/7/7
 * @Description:
 * @apiNote
 */
public class Product {
    private int id;
    private String name;
    private double price;
    private static int totalProducts = 0;

    public Product() {
        totalProducts++;
    }

    public Product(int id, String name, double price) {
        this();
        this.id = id;
        this.name = name;
        this.price = price;
    }
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public static int getTotalProducts() {
        return totalProducts;
    }

    public String getDetail() {
        return "编号：" + id +
                ", 名称：" + name +
                ", 价格：" + price ;
    }
}
